from sklearn.ensemble import BaggingClassifier 
from sklearn import svm
from sklearn.datasets import load_svmlight_file
import sys

bagging = BaggingClassifier(svm.SVC(kernel = 'rbf', C=0.0001, gamma=0.0078),
				max_samples=0.5, max_features=1)
X_train, y_train = load_svmlight_file(sys.argv[1])
X_test, y_test = load_svmlight_file(sys.argv[2])
X_dense=X_train.toarray()
X_test_dense = X_test.toarray()
bagging.fit(X_dense,y_train)
print bagging.score(X_test_dense, y_test)
 
